package schema

import (
	"go-quick/interface/iorm"
	"reflect"
	"sync"
)

type QSchema struct {
	Name                      string
	ModelType                 reflect.Type
	Table                     string
	PrioritizedPrimaryField   iorm.IField
	DBNames                   []string
	PrimaryFields             []iorm.IField
	PrimaryFieldDBNames       []string
	Fields                    []iorm.IField
	FieldsByName              map[string]iorm.IField
	FieldsByBindName          map[string]iorm.IField // embedded fields is 'Embed.Field'
	FieldsByDBName            map[string]iorm.IField
	FieldsWithDefaultDBValue  []iorm.IField // fields with default value assigned by database
	BeforeCreate, AfterCreate bool
	BeforeUpdate, AfterUpdate bool
	BeforeDelete, AfterDelete bool
	BeforeSave, AfterSave     bool
	AfterFind                 bool
	err                       error
	initialized               chan iorm.SignalChan
	namer                     iorm.Namer
	cacheStore                *sync.Map
}
